package com.ssm.user.designPattern.abstractFactoryPattern.easy;

import com.ssm.user.designPattern.abstractFactoryPattern.easy.Color.ColorFactory;
import com.ssm.user.designPattern.abstractFactoryPattern.easy.Shape.ShapeFactory;

public class FactoryProducer {

    public static AbstractFactory getFactory(String choice) {
        if(choice.equalsIgnoreCase("SHAPE")) { //equalsIgnoreCase忽略大小写
            return new ShapeFactory();
        } else if(choice.equalsIgnoreCase("COLOR")) {
            return new ColorFactory();
        }
        return null;
    }
}
